package com.wst.service.impl.weather;

import com.wst.http.HttpAPIService;
import com.wst.http.HttpResult;
import com.wst.service.weather.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @ClassName WeatherServiceImpl
 * @Description TODO
 * @Author yanyi
 * @Date 2019/6/13 13:50
 * @Version 1.0
 **/
@Service
public class WeatherServiceImpl implements WeatherService {

    @Autowired
    @Qualifier("httpAPIService")
    private HttpAPIService httpAPIService;

    @Override
    public HttpResult getWeatherById(String id,String url) {
        HttpResult httpResult=new HttpResult();
        try {
            httpResult=httpAPIService.doPost(url+id+".json");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return httpResult;
    }
}
